<?php
class Cl_MessageManager extends WdkManager 
{
	/**
	 * 생성자
	 */
	function __construct()
	{
		parent::__construct();
		$this->dbo = Wdk::model(basename(__DIR__));
		$this->filter	= array();
		$this->order	= array("`message_insert_time` DESC");
	}
	
	protected function newObj()
	{
		return Wdk::get(basename(__DIR__));
	}
	
	public function NewMessageNum($user_seq=0)
	{
		if($user_seq == 0) return 0;
		return $this->dbo->count(array(	"`message_to` = {$user_seq}",
										"`message_read_flag` = 'F'",
										"`message_to_del_flag` = 'F'"
									)
					);
	}
}